package cruncher;

import java.util.HashSet;
import java.util.Iterator;

public class FixToOneFixingStrategy extends FixingStrategy {

	/***
	 * Return only decision variables with nonzero values
	 */
	@Override
	protected HashSet<Variable> getVariableCandidates(Solution sol)
	{
		HashSet<Variable> filtered = sol.getDecisionVariables();
		Iterator<Variable> it = filtered.iterator();
		while( it.hasNext() ) {
		  Variable x = it.next();
		  if( x.getValue() == 0.0 ) it.remove();
		}
		return filtered;
	}

}
